<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>神龙教主</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul,
        ol,
        li {
            list-style: none;
        }

        .box {
            width: 600px;
            height: 400px;
            border: 10px solid #333;
            margin: 30px auto;
            display: flex;
            flex-direction: column;
        }

        .box>ul {
            width: 100%;
            height: 40px;
            display: flex;
        }

        .box>ul>li {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 30px;
            color: #fff;
            background-color: aquamarine;
        }

        .box>ul>li.active {
            background-color: palevioletred;
        }

        .box>ol {
            flex: 1;
            position: relative;
        }

        .box>ol>li {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            background-color: yellowgreen;
            color: #fff;
            font-size: 100px;
            display: flex;
            justify-content: center;
            align-items: center;
            display: none;
        }

        .box>ol>li.active {
            display: flex;
        }
    </style>
    
</head>

<body>
    <!-- Tab选项卡1 -->
    <div class="box box1">
        <!-- 标题 -->
        <ul>
            <li class="active">🐮</li>
            <li>🐴</li>
            <li>🧟‍♀️</li>
        </ul>
        <!-- 内容 -->
        <ol>
            <li class="active">🙈</li>
            <li>🙉</li>
            <li>🙊</li>
        </ol>
    </div>
    <div class="box box2">
        <!-- 标题 -->
        <ul>
            <li class="active">🐮</li>
            <li>🐴</li>
            <li>🧟‍♀️</li>
        </ul>
        <!-- 内容 -->
        <ol>
            <li class="active">🙈</li>
            <li>🙉</li>
            <li>🙊</li>
        </ol>
    </div>
    <!-- <script src="./tab.js"></script>
    <script>
// import Tab from './tab.js'
const tab1 = new Tab('.box1', {})
const tab2 = new Tab('.box2', {}) -->
<!-- </script> -->
<script>
 let ulLiObjs = document.querySelectorAll('.box ul li')
     ulLiObjs.forEach((item, i) => {
        item.onmouseover = function() {
             document.querySelector('.box ul li.active').className = ''
             this.className = 'active'
             document.querySelector('.box ol li.active').className = ''
             let olLiObjs = document.querySelectorAll('.box ol li')
             olLiObjs[i].className = 'active'
         }
     })
</script>
    